package com.lengxf.netty.command.impl.command_0;

import cn.hutool.json.JSONUtil;
import com.lengxf.netty.command.Command;
import com.lengxf.netty.config.ChannelContext;
import io.netty.channel.Channel;
import org.springframework.stereotype.Service;

@Service
public class Command0 implements Command {

    /**
     * 注册通道类型
     *
     * @Author Lengxf
     */
    @Override
    public void handle(Channel channel, String param) {
        Param0 param0 = JSONUtil.toBean(param, Param0.class);
        ChannelContext.saveChannelType(channel.id().asLongText(), param0.getChannelTypeCode());
    }

}
